package com.tanhua.server.service;

import com.tanhua.dubbo.api.UserApi;
import com.tanhua.model.domain.vo.HuanXinUserVo;
import com.tanhua.model.domain.mysql.User;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @author lk
 * @date 2022-04-01
 */
@Service
public class HuanXinService {

    @DubboReference
    private UserApi userApi;

    //通过手机号
    public HuanXinUserVo findByHuanXinUser() {
        String mobile = UserHolder.getMobile();
        User user = userApi.findByMobile(mobile);
        HuanXinUserVo huanXinUserVo = new HuanXinUserVo(user.getHxUser(), user.getHxPassword());
        return huanXinUserVo;
    }
}
